home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ 2⁄16⁄90 / 0668-Data Dilemma-Feb90 < prev    next >
Encoding:
Text File  |  1990-02-16  |  1.9 KB  |  45 lines  |  [TEXT/GEOL]

  1. Item forwarded  by  A33          to A34
  2.  
  3. Item    3649324                         14-Feb-90        08:29PST
  4.  
  5. From:   D4280                           IDS, Robert Pappas,AST
  6.  
  7. To:     MACAPP.TECH$                    MacApp Technical
  8.         JAIME1                          Cummins, Jaime
  9.  
  10. Sub:    Data Dilemma
  11.  
  12.  
  13.  
  14. MacAppers -
  15.  
  16. Background: I am creating a document editor that contains the ability to insert
  17. and edit text blocks, insert and edit mini-spreadsheets, and also insert
  18. dynamic graphs that reflect the spreadsheet data. Associated  with each view of
  19. these objects is some data. For instance, the text contains tags that the user
  20. never sees, he sees a string that represents some data value; the Draw method
  21. of the text block expands the tag to real text. So we have "shadow data", data
  22. that is used to create and draw the view.
  23.  
  24. Dilemma: Where do I put the data? It seems that from most of the MacApp demo's,
  25. the views do not contain the data. The TDocument contains objects that are the
  26. data. Those data objects do not draw themselves. A seperate view object that
  27. knows where to get the data does the drawing. So a separate data reference
  28. chain is needed to manage the data. The data reference chain and the view chain
  29. need to reference each other also. Also, the data and the views must be saved
  30. to disk when the document is. So you have 2 parts of the document: Content info
  31. (data) and Layout info (Views).
  32.  
  33. I am leaning toward having views manage data. A view that manages data has a
  34. sub-view that knows how to draw it. That way I can take advantage of the
  35. sub-view/super-view reference chain for binding the data and the views. Also
  36. some other things are slick like DoRead and DoWrites. This makes me nervous
  37. because I haven't seen anybody else do it this way. Hence views manage the
  38. Content as well as the Layout.
  39.  
  40. I would appreciate any comments!!!
  41.  
  42. Thanks, Bob Pappas
  43. IDS Financial Services
  44.  
  45.